from Models import DTO
from Models import Properties
from google.appengine.api import users

class PropertiesUtils:
    
    def getProperties(self):
        prop = Properties.gql("WHERE user = :1", users.get_current_user().email()).get()
        dto = DTO()
        dto.recieveEmails = prop.recieveEmails
        dto.findAlternatives = prop.findAlternatives
        return dto
    
    def setProperties(self,propObject):
        prop = Properties.gql("WHERE user = :1", users.get_current_user().email()).get()        
        prop.recieveEmails = propObject.recieveEmails
        prop.findAlternatives = propObject.findAlternatives
        prop.put()
        return 1
    
        